More speed and less memory usage via code generation#2
More speed and less memory usage via code generation#2nitram509 wants to merge 44 commits intobenlowry:masterfrom
Conversation
FIX: country name contains a '\r' on windows
…tected, as unit tests are green now
using country-names list with index, which results in half the memory usage
Merge branch 'master' into code_generation Conflicts: geoip.js
|
Hello Martin! |
|
Looks like your version returns incorrect results as well. |
|
Jup, it seems there are still wrong lookups. Thanks for pointing this out. |
|
Looks like it gives wrong results all the time. :) Some examples: "93.32.0.0","93.71.255.255","1562378240","1564999679","IT","Italy" "138.187.0.0","138.191.255.255","2327511040","2327838719","CH","Switzerland" "213.87.0.0","213.88.127.255","3579248640","3579346943","RU","Russian Federation" |
… and combining this with more range/equation checks
|
Please, verify my last commit. |
|
I'm curious, what do you think about this approach "using code generation" in general? |
|
I didn't dig too much into the code, but your variant is working 50% faster for me. |
|
Uncovered two more bugs: The last and second last IP-range are not correctly detected. I'm working on a fix. |
|
huh, I hope not too many of my players live in these IP-ranges. :) |
…ll not be catched
… "Virgin Islands, British" are treated the same
…. "Virgin Island, British")
|
Done. I've fixed the two bugs. I would be glad, if you consider to accept this pull request. |
Hi,
I've made some more progressive enhancements within my fork of 'node-geoip-native'.
The basic ideas:
In general, I've measured ca. 10% performance increase during lookup
and a drop from ca. 50MB to ca. 30MB heap usage.
Please, check out this branch 'code_generation' and tell me what you think.
Tanks in advance
Martin